package io.plus.server.utils;

import io.plus.common.packet.metadata.Command;
import io.plus.common.packet.metadata.ResponseMessage;
import io.plus.common.protocol.IPacketConverter;
import io.plus.common.protocol.Packet;
import io.plus.common.protocol.PacketConverter;
import io.plus.engine.pulse.AsynchronousSocketChannelContext;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ImKit {
    public static Packet convertResponsepPacket(Packet packet, Command command, AsynchronousSocketChannelContext asynchronousSocketChannelContext) {
        Packet respPacket = convertResponsepPacket(packet.getBody(), command, asynchronousSocketChannelContext);
        return respPacket;
    }

    public static Packet convertResponsepPacket(byte[] body, Command command, AsynchronousSocketChannelContext asynchronousSocketChannelContext) {
        IPacketConverter packetConverter = new PacketConverter();
        Packet respPacket = packetConverter.converteResponsepPacket(asynchronousSocketChannelContext, command, body);

        return respPacket;
    }


    public static Packet convertResponsepPacket(AsynchronousSocketChannelContext asynchronousSocketChannelContext, ResponseMessage respBody) {
        return null;
    }
}
